import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EventAssetsVo, EventAssetsQuery, EventManagerConfigsVo, ProjectListV30ResponseDataListInner } from './types';
// 新增
export const createProjectPromotion = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/third/createProjectPromotion',
    method: 'post',
    data: query
  });
};
// /oce/template 保存模板
export const getProjectPromotionTemplate = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/template',
    method: 'post',
    data: query
  });
};
//  /oce/template/list 获取模板列表
export const getProjectPromotionTemplateList = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/template/list',
    method: 'get',
    params: query
  });
};

//  /oce/third/getProjectList 获取项目
export const getProjectList = (query: {
  advertiserId: number;
  accountId: number;
  pageNum: number;
  pageSize: number;
}): AxiosPromise<ProjectListV30ResponseDataListInner[]> => {
  return request({
    url: '/oce/third/getProjectList',
    method: 'get',
    params: query
  });
};
// /oce/third/createProjectPromotionPreview 预览
export const createProjectPromotionPreview = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/third/createProjectPromotionPreview',
    method: 'post',
    data: query
  });
};
export const getProductDetail = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/third/getProductDetail',
    method: 'get',
    params: query
  });
};
// /oce/templateTask
export const addTemplateTask = (query: EventAssetsQuery): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/templateTask',
    method: 'post',
    data: query
  });
};
// /oce/templateTask/{taskId}
export const getTemplateTask = (taskId: number): AxiosPromise<EventAssetsVo[]> => {
  return request({
    url: '/oce/templateTask/' + taskId,
    method: 'get'
  });
};
